<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShopConfigTable extends Migration
{
    public function up()
    {
        Schema::create('shop_config', function (Blueprint $table) {
            $table->increments('id');

            $table->string('shop_name')->default('shop_name')->comment('商城名称');
            $table->string('shop_url')->default('www.shop.com')->comment('商城网址');
            $table->string('shop_email')->default('admin@shop.com')->comment('官方邮箱');
            $table->string('shop_tel')->default('010-1234-1234')->comment('客服电话');
            $table->string('shop_operation_time')->default('09:00 ~ 12:00 and  14:00~17:00')->comment('运营时间');


            $table->tinyInteger('cash_discount_type')->default(0)->comment('cash 抵扣类型 0=百分比 ,1=固定值  默认=百分比');
            $table->integer('cash_discount_value')->default(0)->comment('cash 抵扣值 ');
            $table->tinyInteger('sp_discount_type')->default(0)->comment('sp 抵扣类型 0=百分比 ,1=固定值  默认=百分比');
            $table->integer('sp_discount_value')->default(0)->comment('sp 抵扣值 ');


            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('shop_config');
    }
}
